﻿using System;
using System.Collections.Generic;

using System.Text;
using Estimate.Common.Entity;
using Estimate.Common.Repository;

namespace Estimate.OldSemiCompare.Transfer
{
    public class SiteForeTransfer :BaseForeTransfer
    {
        public SiteForeTransfer(string oldConnectionString, string newConnectionString)
            : base(oldConnectionString, newConnectionString)
        {

        }

        public override string GetTableName()
        {
            return "SiteFore";
        }

        protected override ForeRepository getRepository(string table)
        {
            string user = table.Substring(0, table.IndexOf('_'));
            int result;
            if (!int.TryParse(user,out result))
            {
                return ForeRepositoryFactory.SiteForeRepository(_newConnectionString, user);
            }
            throw new Exception(string.Format("table {0}不做处理！", table));
        }
    }
}
